package main

import (
	"fmt"
	"main/my_interface"
	"os"
	"time"

	"gopkg.in/ini.v1"
)

func main() {
	cfg, err := ini.Load("config.ini")
	if err != nil {
		fmt.Printf("Fail to read file: %v", err)
		os.Exit(1)
	}
	portName := cfg.Section("").Key("portName").String()
	baud, _ := cfg.Section("").Key("baud").Int()

	fmt.Println("portName=", portName, "baud=", baud)
	my_interface.SerialStart(portName, baud)

	time.Sleep(time.Second)
}
